In general, a document conveying apparatus such as a scanner has a function of determining whether a document is conveyed or not by using an optical encoder, and when a document is not conveyed even though a motor is driven, a jam is determined to have occurred and the operation of the apparatus is stopped. The encoder includes a disk formed with many slits (transmission holes for light) and configured to rotate as a document is conveyed, and a light source and a light reception element provided to face each other with the disk interposed therebetween. The light reception element outputs an electric signal according to the received light quantity. The document conveying apparatus measures a document conveying quantity by measuring the number of times of changes between a state in which there exists a slit between the light source and the light reception element and a state in which a slit does not exist and the light is obstructed by the disk based on the electric signal, and determines whether a document is conveyed or not.
For example, the document conveying apparatus compares the electric signal that is output by the light reception element with a fixed threshold value, thus determining whether there is any change between a state in which there exists a slit between the light source and the light reception element and a state in which a slit does not exist and the light is obstructed by the disk. However, due to the light emitted from the light source and leaked out from the portions other than the slits of the disk, noise component may be overlaid on the electric signal that is output by the light reception element. In that case, even though a document is conveyed and accordingly the disk is rotating, the electric signal that is output by the light reception element may become equal to or more than fixed threshold value, or equal to or less than the fixed threshold value at all times, and this may make it impossible to correctly determine a change in the state of the slit.
A rotation angle detection apparatus for determining the rotation angle of a crank shaft of an internal combustion engine is disclosed (see Japanese Laid-open Patent Publication No. H4-140451). This rotation angle detection apparatus includes a disk rotating in synchronization with the crank shaft, multiple magnetic protrusions arranged with a regular interval along a circumference of the disk, an electromagnetic-type pickup arranged to face the rotation surface of the disk and face the magnetic protrusions, and a waveform shaping circuit. The waveform shaping circuit integrates the level of the output signal of the electromagnetic-type pickup, and generates a reference voltage that follows the frequency of the pulsation noise component. This reference voltage is a median value of an alternating current signal obtained by combining the original output signal and the pulsation noise component. The waveform shaping circuit compares the output signal and the reference voltage, and generates a square wave in which the effect based on the pulsation noise component is alleviated, and the rotation angle detection apparatus determines the rotation angle of the crank shaft based on the square wave.
A waveform shaping method of a signal of a non-contact-type speed detection apparatus that uses a non-contact displacement sensor and a rotation body having a toothed wheel or formed with protrusions and recesses to detect the number of revolutions and the rotation speed of the rotation body is disclosed (see Japanese Laid-open Patent Publication No. H2-265315). In this method, with respect to a source signal having an alternating current component overlaid on a direct current component, a signal in which the phase of the main waveform of the alternating current component of this source signal is configured to be different is compared while the levels of the direct current components in both signals are configured to be the same, so that a square signal that matches a cycle of the main waveform of the alternating current signal is generated.